{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_jypx/template/public/ygcss.css">
<style type="text/css">
    input[type="radio"] + label::before {
        content: "\a0"; /*不换行空格*/
        display: inline-block;
        vertical-align: middle;
        font-size: 16px;
        width: 1em;
        height: 1em;
        margin-right: .4em;
        border-radius: 50%;
        border: 2px solid #ddd;
        text-indent: .15em;
        line-height: 1; 
    }
    input[type="radio"]:checked + label::before {
        background-color: #44ABF7;
        background-clip: content-box;
        padding: .1em;
        border: 2px solid #44ABF7;
    }
    input[type="radio"] {
        position: absolute;
        clip: rect(0, 0, 0, 0);
    }
    .ygmargin{margin-top: 10px;color: #999;}
     .dizhi{margin-top: 10px;color: #44ABF7;}
 .yginp{width: 50%;}
 .ygspan{line-height: 35px;margin-left: 10px;}
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li><a href="{php echo $this->createWebUrl('task',array('id'=>$_GPC['id']))}">作业列表</a></li>
    <li class="active"><a href="{php echo $this->createWebUrl('addtask2',array('id'=>$_GPC['unit_id']))}">添加作业</a></li>
</ul>
<div class="main">
    <form action="" name="form" role="form" method="post" class="form-horizontal form" enctype="multipart/form-data" id="invitative">
        <div class="panel panel-default ygdefault">
            <!-- <div class="panel-heading wyheader">
                作业管理&nbsp;>&nbsp;添加作业
            </div> -->
            <div class="panel-body">

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">课节名称</label>
                    <div class="col-sm-9">
                        <!-- <input type="text" name="cate_name" class="form-control" value="{$info['cate_name']}" /> -->
                    <select name="name">
                        {loop $cates $item}
                        <option value="{$item['id']}"> {$item['unit_name']}</option>
                        {/loop}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">作业名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="title" class="form-control" value="" />
                    </div>
                </div>
               <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">缩略图</label>
                    <div class="col-sm-9">
                        {php echo tpl_form_field_image('thumb')}
                        <span class="help-block">*建议宽高2:1</span>
                    </div>
                </div>
  
        <!--         <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">视屏作业</label>
                    <div class="col-sm-9">
                        {php echo tpl_form_field_video('video')}
                        <span class="help-block">*建议宽高2:1</span>
                    </div>
                </div> -->
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">视频文件路径</label>
                    <div class="col-sm-10">
                       <!-- {php echo tpl_form_field_coordinate('op',$list['coordinates'])} -->
                       <input type="text" name="video" class="form-control dizhiname" value="{$item['video']}" placeholder="例如:http://p83kbhxav.bkt.clouddn.com/03000A01005AB41B8A0CF2617205AAFA865DBB-F93B-D2AA-23C6-FD63C5906022.mp4" />
                       <a href="https://www.qiniu.com/" target="_blank">
                           <p class="dizhi">*点击上传视频文件</p></a>
                       </div>
                   </div>
                   <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">音频文件路径</label>
                    <div class="col-sm-10">
                       <!-- {php echo tpl_form_field_coordinate('op',$list['coordinates'])} -->
                       <input type="text" name="voice" class="form-control dizhiname" value="{$item['voice']}" placeholder="例如:http://p83kbhxav.bkt.clouddn.com/test.wav" />
                       <a href="https://www.qiniu.com/" target="_blank">
                           <p class="dizhi">*点击上传音频文件</p></a>
                       </div>
                   </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">作业描述</label>
                    <div class="col-sm-9">
                        {php echo tpl_ueditor('describe');}
                    </div>
                </div>
            </div>
        </div>


        <div class="form-group">
            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>
            <input type="hidden" name="token" value="{$_W['token']}" />
            <input type="hidden" name="id" value="{$info['id']}" />
        </div>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        // $("#frame-2").addClass("in");
        $("#frame-5").show();
        $("#yframe-5").addClass("wyactive");
        "{if $info}"
            "{if $info['item']=='1'}"
                $('.ygyi2').hide();
                $('.ygyi3').hide();
            "{/if}"
            "{if $info['item']=='2'}"
                $('.ygyi1').hide();
                $('.ygyi3').hide();
            "{/if}" 
            "{if $info['item']=='3'}"
                $('.ygyi1').hide();
                $('.ygyi2').hide();
            "{/if}"            
        "{else}"
            $('.ygyi2').hide();
            $('.ygyi3').hide();
        "{/if}"
        $("select#type").change(function(){
            if($(this).val()=='1'){
                console.log($(this).val())
                $(".ygyi1").show();
                $(".ygyi2").hide();
                $(".ygyi3").hide();  
            }else if($(this).val()=='2'){
                console.log($(this).val())
                $(".ygyi1").hide();
                $(".ygyi2").show();
                $(".ygyi3").hide();  
            }else if($(this).val()=='3'){
                console.log($(this).val())
                $(".ygyi1").hide();
                $(".ygyi2").hide();
                $(".ygyi3").show();  
            }
         })
    })
</script>